Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: support hiding empty services #1264

Closed

Conversation

wenxuan70
Copy link

Please provide issue(s) of this PR:
Fixes #1182 #1133

polaris-console相关的PR:
polarismesh/polaris-console#247

To help us figure out who should review this PR, please put an X in all the areas that this PR affects.

  • ApiServer
  • Auth
  • Configuration
  • Naming
  • HealthCheck
  • Metrics
  • Docs
  • Installation
  • Performance and Scalability
  • Test and Release

Please check any characteristics that apply to this pull request.

  • Does not have any user-facing changes. This may include API changes, behavior changes, performance improvements, etc.

@polaris-test-bot
Copy link

polaris-test-bot commented Sep 28, 2023

2023-09-28 17:21:14: =========TEST START==========
2023-10-13 15:23:43: =========TEST START==========
2023-10-13 15:24:42: 构建失败 !本次自动化测试将终止!失败原因:bash ./release/build.sh v1.18.0 "amd64"

@wenxuan70
Copy link
Author

@chuntaojun 大佬有空帮忙review下

if hideEmptyService {
nonEmptyServices := make([]*model.EnhancedService, 0, len(services))
for _, service := range services {
if service.HealthyInstanceCount > 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

参数描述和实际逻辑不符合,建议改为 only_exist_healthyinstance

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个查询逻辑应该放在 s.caches.Service().GetServicesByFilter 里面,否则你这个查询是有问题的

@@ -156,6 +159,9 @@ func EnrichGetServicesApiDocs(r *restful.RouteBuilder) *restful.RouteBuilder {
" 和 instance_values 需要同时填写且必须元素个数一致").
DataType(typeNameString).
Required(false)).
Param(restful.QueryParameter("hide_empty_service", "隐藏空服务").DataType(typeNameBool).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没有隐藏空服务这个逻辑了吧?

if hideEmptyService {
nonEmptyServices := make([]*model.EnhancedService, 0, len(services))
for _, service := range services {
if service.HealthyInstanceCount > 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个查询逻辑应该放在 s.caches.Service().GetServicesByFilter 里面,否则你这个查询是有问题的

@chuntaojun chuntaojun closed this Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

存在上线节点的服务排列表前面,方便查看
3 participants